<div class="top-fixed">
    <div class="navbar" style="max-width: 640px;margin: auto;">
        <div class="navbar-inner">
            <div class="left">
                <a href="javascript:history.back();" class=""><i class="fa fa-angle-left" style="font-size: 30px;"></i></a>
            </div>
            <div class="center">用户管理</div>
            <div class="right">

            </div>
        </div>
    </div>
</div>
<section class="main" style="max-width: 640px;margin: auto;">
    <div id="order-by" class="table bgf tc fs14 order_nav">
        <a href="/partner_users?order_by=id-desc"
           class="table-cell {{#if_eq query.order_by 'id-desc'}}active{{/if_eq}}">
            <span class="hint-num">倒序</span>
        </a>
        <a href="/partner_users?order_by=id-asc"
           class="table-cell {{#if_eq query.order_by 'id-asc'}}active{{/if_eq}}">
            <span class="hint-num">正序</span>
        </a>
        <a href="/partner_users?order_by=amount-desc"
           class="table-cell {{#if_eq query.order_by 'amount-desc'}}active{{/if_eq}}">
            <span class="hint-num">余额</span>
        </a>
        <a href="/partner_users?order_by=frozen-desc"
           class="table-cell {{#if_eq query.order_by 'frozen-desc'}}active{{/if_eq}}">
            <span class="hint-num">冻结</span>
        </a>
        <a href="/partner_users?order_by=order_count-desc"
           class="table-cell {{#if_eq query.order_by 'order_count-desc'}}active{{/if_eq}}">
            <span class="hint-num">订单</span>
        </a>
        <a href="/partner_users?order_by=sham_count-desc"
           class="table-cell {{#if_eq query.order_by 'sham_count-desc'}}active{{/if_eq}}">
            <span class="hint-num">虚假</span>
        </a>
    </div>
    <div class="weui_search_bar" id="search_bar">
        <form class="weui_search_outer" id="search_form" method="get" action="/partner_users">
            <div class="weui_search_inner">
                <i class="weui_icon_search"></i>
                <input type="search" class="weui_search_input" id="search_input" name="keyword"
                       placeholder="用户编号或用户名搜索"
                       required value="{{query.keyword}}"/>
                <a href="javascript:" class="weui_icon_clear" id="search_clear"></a>
            </div>
            <label for="search_input" class="weui_search_text" id="search_text">
                <i class="weui_icon_search"></i>
                <span>用户编号或用户名搜索</span>
            </label>
        </form>
        <a href="javascript:" class="weui_search_cancel" id="search_cancel">取消</a>
    </div>
    <div class="contact_con fs13">
        {{#if rows}}
            <ul class="list-wrapper">
                {{#each rows}}
                    <li class="bb">
                        <dl class="table ptb10">
                            <dt class="table-cell vm w70 plr10">
                                <div class="br50 item-pic">
                                    {{#if image}}
                                        <img src="{{image}}?imageView2/1/w/150/h/150/q/75" class="imgm">
                                    {{^}}
                                        <img src="images/default-none-head.png" class="imgm">
                                    {{/if}}
                                </div>
                            </dt>
                            <dd class="table-cell vm">
                                <p class="col3 single-line">{{or nickname tel}} 「ID:{{id}}」</p>
                                {{#if agency_user}}
                                    <p class="col3 single-line">
                                        <a href="/partner_users?agency_id={{agency_id}}"
                                           class="blue">代理: {{or agency_user.nickname agency_user.tel}}
                                            「ID:{{agency_user.id}}」</a>
                                    </p>
                                {{/if}}
                                {{#if inviter_user}}
                                    <p class="col3 single-line">
                                        <a href="/partner_users?inviter_id={{inviter_id}}"
                                           class="blue">邀请人: {{or inviter_user.nickname inviter_user.tel}}
                                            「ID:{{inviter_user.id}}」</a>
                                    </p>
                                {{/if}}
                            </dd>
                            <dt class="table-cell vm" style="width: 25%;">
                                <span class="tc col9 call">{{level_dict.text}}</span>
                                <p class="col6 single-line">
                                    <a href="/partner_users?inviter_id={{id}}"
                                       class="blue">
                                        邀请数({{invite_count}})
                                    </a>
                                </p>
                            </dt>
                        </dl>
                        <div class="table tc">
                            <a href="/user_finances?user_id={{id}}" class="table-cell br">
                                <p>余额: <span class="fs18 red bold">{{amount}}</span></p>
                            </a>
                            <a href="/user_finances?user_id={{id}}" class="table-cell br">
                                <p>冻结: <span class="fs18 blue bold">{{frozen}}</span></p>
                            </a>
                            <a href="/partner_orders?user_id={{id}}" class="table-cell br">
                                <p>订单: <span class="fs18 green bold">
                                    {{order_count}}/{{finish_count}}/{{sham_count}}
                                </span></p>
                            </a>
                        </div>
                        <div class="table">
                            <dd class="table-cell vm p10">
                                <p class="col6">{{format_datetime created_at}}</p>
                            </dd>
                            {{#if_eq level 'Agency'}}
                                <dd class="table-cell vm p10 tc">
                                    <a href="/partner_orders?agency_id={{id}}" class="blue ">代理订单</a>
                                </dd>
                            {{/if_eq}}
                            <dd class="table-cell vm p10 tr">
                                <a href="/partner_orders?user_id={{id}}" class="blue ">用户订单</a>
                            </dd>
                        </div>
                    </li>
                {{/each}}
            </ul>

            <div class="loadmore-wrapper loadmore" style="margin: 10px;">
                {{#if loadmore}}
                    <div class="weui-infinite-scroll">
                        <div class="infinite-preloader"></div>
                        正在加载...
                    </div>
                {{/if}}
            </div>
        {{^}}
            <div class="tc nothing">
                <span class="mt10 fs14 col9">用户列表为空</span>
            </div>
        {{/if}}
    </div>
</section>